package com.dog.basics.netty.business.impl;

import com.dog.basics.netty.business.IBusinessServer;
import com.dog.basics.netty.protobuf.dto.DogNewsContentDto;
import com.dog.basics.netty.util.ConstantUtil;
import io.netty.channel.ChannelHandlerContext;
import lombok.extern.log4j.Log4j2;

/**
 * @description: 未注册登录响应
 * @author: He
 * @date: Created in 2020/10/8 18:52
 * @version: 1.0
 * @modified By:
 */
@Log4j2
public class ResponseHandlerImplUnregistered implements IBusinessServer<DogNewsContentDto.Message> {

    /**
     * @功能描述: 未注册登录响应
     * @author He
     * @date 2020/10/8
     */
    @Override
    public void businessHandler(ChannelHandlerContext ctx, DogNewsContentDto.Message msg) throws InterruptedException {
        log.info("未注册登录响应:{}", msg.toString());
        ctx.channel().writeAndFlush(DogNewsContentDto.Message.newBuilder().setMsgType(ConstantUtil.UNREGISTERED));
        ctx.channel().close();
    }
}